package org.example.springioc.DI;

import org.example.springioc.Service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Controller1 {

//    方法1. 属性注入
    @Autowired
    private UserService userService;

    public void say(){
        userService.doService();
        System.out.println("hello Controller1");
    }
}
